<template>
    <el-dialog
        v-if="safeFlag"
        title="提示"
        :visible="safeFlag"
        width="65%"
        center
        @close="clonseDialog"
        :close-on-click-modal="false"
        :destroy-on-close="true"
        :lock-scroll="false"
    >
        <span slot="title">安全施工巡查</span>
        <!-- 工单基本信息 -->
        <div class="content">
            <p class="title">工单基本信息</p>
            <div class="base_info">
                <div>工单编号：{{ formObj.pmsConstructionOrder.orderNo }}</div>
                <div>工单名称：{{ formObj.pmsConstructionOrder.propertyName }}</div>
                <div>工程面积：{{ formObj.pmsConstructionOrder.renovationTotalArea }}</div>
            </div>
            <div class="base_info">
                <div>
                    工程地址：
                    {{ formObj.pmsConstructionOrder.orderProjectAddress }}
                </div>
                <div>甲方联系人：{{ formObj.pmsConstructionOrder.followUpEmp }}</div>
                <div>甲方联系电话：{{ formObj.pmsConstructionOrder.followUpPhone }}</div>
            </div>
        </div>
        <!-- 检查项 -->
        <div class="inside-wrapper">
            <p class="title">检查项</p>
            <!-- 遍历循环 -->
            <div v-for="(item, index) in formObj.recordList" :key="index">
                <p class="second-title" v-if="item.constructionEmp != ''">施工人员：{{ item.constructionEmp }}</p>
                <p class="second-title" v-else-if="item.fireEquipment != ''">消防设备：{{ item.fireEquipment }}</p>
                <p class="second-title" v-else-if="item.safetyPatrol != ''">安全警示：{{ item.safetyPatrol }}</p>
                <div class="pic-upload">
                    <Upload
                        :uploadImage.sync="item.uploadImage"
                        :disabledUpload="!(formObj.taskStatus == 1 || formObj.taskStatus == 3)"
                    ></Upload>
                </div>
                <p class="second-title cover-color">最少1张，可上传多张</p>
            </div>
        </div>
        <!-- 附件上传 -->
        <div class="origin-layout">
            <p class="title">附件上传</p>
            <div>
                <div class="pic-upload">
                    <!-- <Upload
                        :uploadImage.sync="formObj.fileIds"
                        :disabledUpload="!(formObj.taskStatus == 1 || formObj.taskStatus == 3)"
                    ></Upload> -->
                    <UploadFiles :uploadFile.sync="formObj" :limitSize="1"></UploadFiles>
                </div>
                <p>《施工安全检查表》供应商盖章扫描件（必填）</p>
            </div>
        </div>
        <span slot="footer" class="dialog-footer">
            <el-button @click="clonseDialog">取 消</el-button>
            <!--      v-if="formObj.taskStatus == -1 || formObj.taskStatus == -3"-->
            <template v-if="formObj.canOperating">
                <el-button type="primary" @click="saveDialog">保存</el-button>
                <el-button type="primary" @click="submitDialog">提交</el-button>
            </template>
        </span>
    </el-dialog>
    <el-dialog
        v-else
        title="提示"
        :visible="safeFlag"
        width="65%"
        center
        @close="clonseDialog"
        :close-on-click-modal="false"
        :destroy-on-close="true"
        :lock-scroll="false"
    >
        <span slot="title">安全施工验收</span>
        <!-- 工单基本信息 -->
        <div class="content">
            <p class="title">工单基本信息</p>
            <div class="base_info">
                <div>工单编号：{{ a }}</div>
                <div>工单名称：{{ a }}</div>
                <div>工程面积：{{ a }}</div>
            </div>
            <div class="base_info">
                <div>工程地址： {{ a }}</div>
                <div>甲方联系人：{{ a }}</div>
                <div>甲方联系电话：{{ a }}</div>
            </div>
        </div>
        <!-- 进场材料 -->
        <div class="inside-wrapper">
            <p class="title">安全施工</p>
            <!-- 遍历循环 -->
            <div>
                <p class="second-title">造价材料名称：电线BV-2.5m㎡安装</p>
                <div class="pic-upload">
                    <el-upload
                        :action="uploadHttp"
                        list-type="picture-card"
                        :auto-upload="true"
                        :limit="5"
                        :file-list="outRoom"
                        :headers="{ token: getToken() }"
                        :on-success="uploadSuccess"
                    >
                        <i slot="default" class="el-icon-plus"></i>
                        <div slot="file" slot-scope="{ file }">
                            <img class="el-upload-list__item-thumbnail" :src="file.url" alt="" />
                            <span class="el-upload-list__item-actions">
                                <span class="el-upload-list__item-delete" @click="remove(file)">
                                    <i class="el-icon-delete"></i>
                                </span>
                            </span>
                        </div>
                    </el-upload>
                </div>
                <p class="second-title cover-color">最少1张，可上传多张</p>
            </div>
        </div>
        <!-- 附件上传 -->
        <div class="origin-layout">
            <p class="title">附件上传</p>
            <div>
                <div class="pic-upload">
                    <el-upload
                        :action="uploadHttp"
                        list-type="picture-card"
                        :auto-upload="true"
                        :limit="5"
                        :file-list="fileUpload"
                        :on-success="uploadSuccessfileUpload"
                    >
                        <i slot="default" class="el-icon-plus"></i>
                        <div slot="file" slot-scope="{ file }">
                            <img class="el-upload-list__item-thumbnail" :src="file.url" alt="" />
                            <span class="el-upload-list__item-actions">
                                <span class="el-upload-list__item-delete">
                                    <i class="el-icon-delete"></i>
                                </span>
                            </span>
                        </div>
                    </el-upload>
                </div>
                <p>《安全施工验收表》供应商盖章扫描件（必填）</p>
            </div>
        </div>
        <span slot="footer" class="dialog-footer">
            <el-button @click="clonseDialog">取 消</el-button>
            <el-button type="primary" @click="submitDialog">保存</el-button>
        </span>
    </el-dialog>
</template>

<script lang="ts">
import SafeDialog from './SafeDialog.js';
export default {
    ...SafeDialog
};
</script>

<style scoped lang="less">
@import 'SafeDialog.less';
</style>
